define(function (require, exports, module) {

    var $ = require("jquery");

    var index = {

        init: function () {

            $("a[name='send']").bind("click", function () {
                $.ajax({
                    url: "jms.do?method=publishTopic",
                    type: "post",
                    dataType: "json",
                    data: {
                        message: $("textarea[name='messageBox']").val()
                    },
                    success: function (data) {
                        if (data != 1) {
                            alert("发生失败！");
                        }
                    },
                    error: function () {
                        alert("发生系统错误！");
                    }
                });
            });


        }
    };

    exports.init = function () {
        index.init();
    }

});